<template>
	<page-body>
		<view class="page">
			<!---flex布局flex布局开始-->
			<view class="flex flex-direction flex-wrap align-stretch benben-flex-layout verificationLogin_flex_0">
				<view class='flex flex-direction flex-wrap align-center justify-between verificationLogin_fd0_0'>
					<image class='verificationLogin_fd0_0_c0' mode="aspectFit" :src='STATIC_URL+"1572.png"'></image>
					<text class='verificationLogin_fd0_0_c1'>{{$t('AI硅基智能教学平台')}}</text>
				</view>
				<view class='flex flex-wrap align-center verificationLogin_fd0_1'>
					<image class='verificationLogin_fd0_1_c0' mode="aspectFit" :src='STATIC_URL+"3.png"'></image>
					<benben-input class='flex-sub verificationLogin_fd0_1_c1' type="number" :placeholder="$t('请输入手机号')"
						confirm-type="done" :maxlength="11" placeholder-style="color:#999;font-size:28rpx"
						v-model="phone" />
				</view>
				<view class='flex flex-wrap align-center verificationLogin_fd0_2'>
					<image class='verificationLogin_fd0_1_c0' mode="aspectFit" :src='STATIC_URL+"7.png"'></image>
					<benben-input class='flex-sub verificationLogin_fd0_1_c1' type="number" :placeholder="$t('请输入验证码')"
						confirm-type="done" :maxlength="4" placeholder-style="color:#999;font-size:28rpx"
						v-model="verification" />
					<benben-send-verification-code key='1718866697312' ref="vCode1718866697312"
						class=' verificationLogin_fd0_2_c2' :after-text="$t('后重新获取')" :before-text="$t('获取验证码')"
						:emptye-text="$t('请输入手机号')" :validate-text="$t('请输入正确的手机号')" account-type='phone' :auto='true'
						:is-environment-verification='false' type='3' :phone="phone"></benben-send-verification-code>
				</view>
				<view class='flex flex-direction-row-reverse flex-wrap align-center verificationLogin_fd0_3'>
					<text class='verificationLogin_fd0_3_c0' @tap.stop="handleJumpDiy" data-type="redirectTo"
						:data-url="`/pages/tabBar/login/login`">{{$t('密码登录')}}</text>
				</view>
				<button class='verificationLogin_fd0_4' @tap.stop="getcbc78dca45ebc1Func()">{{$t('登录')}}</button>
				<view class='flex flex-wrap align-center justify-center verificationLogin_fd0_5'>
					<text class='verificationLogin_fd0_5_c0' @tap.stop="handleJumpDiy" data-type="redirectTo"
						:data-url="`/pages/dlzc/forgetPasswords/forgetPasswords`">{{$t('忘记密码')}}</text>
				</view>
				<view class='flex flex-direction align-stretch verificationLogin_fd0_6'>
					<!--     <view   class='flex align-center justify-center verificationLogin_fd0_6_c0'      >
        <image class='verificationLogin_fd0_6_c0_c0'  mode="aspectFit"  :src='STATIC_URL+"1532.png"'></image>
<image class='verificationLogin_fd0_6_c0_c0'  mode="aspectFit"  :src='STATIC_URL+"1533.png"'></image>
<image class='verificationLogin_fd0_6_c0_c0'  mode="aspectFit"  :src='STATIC_URL+"5.png"'></image>
<image class='verificationLogin_fd0_6_c0_c0'  mode="aspectFit"  :src='STATIC_URL+"1534.png"'></image>
<image class='verificationLogin_fd0_6_c0_c4'  mode="aspectFit"  :src='STATIC_URL+"1535.png"'></image>
</view>
 -->
					<view class='flex align-stretch justify-center verificationLogin_fd0_6_c1'>
						<benben-flex-switch-new class-name='flex flex' v-model="di_tk" :disabled='false'>
							<template v-slot:checked>

								<view class='flex align-stretch flex'>
									<image class='verificationLogin_checkfd0_6_c1_c0_c0_c0' mode="aspectFit"
										:src='STATIC_URL+"1573.png"'></image>
								</view>

							</template>
							<template v-slot:unchecked>

								<view class='flex align-stretch justify-end flex'>
									<image class='verificationLogin_checkfd0_6_c1_c0_c0_c0' mode="aspectFit"
										:src='STATIC_URL+"277.png"'></image>
								</view>

							</template>
						</benben-flex-switch-new>
						<view class='verificationLogin_fd0_6_c1_c1'>
							<text class='verificationLogin_fd0_6_c1_c1_c0'>{{$t('已阅读并同意')}}</text>
							<text class='verificationLogin_fd0_6_c1_c1_c1' @tap.stop="handleJumpDiy"
								data-type="navigateTo"
								:data-url="`/pages/dlzc/privacyPolicy/privacyPolicy`">{{$t('《隐私政策》')}}</text>
						</view>
					</view>
				</view>
			</view>

			<!---flex布局flex布局结束-->


		</view>
	</page-body>
</template>
<script>
	import {
		validate
	} from '@/common/utils/validate.js'

	export default {
		components: {},


		data() {
			return {
				"phone": "",
				"verification": "",
				"dataList": {
					"userinfo": {
						"user_token": "",
						"id": "",
						"avatar": "",
						"real_name": "",
						"nickname": "",
						"email": "",
						"gender": "",
						"mobile": "",
						"birthday": "",
						"client_id": "",
						"phone": ""
					}
				},
				"di_tk": false
			};
		},
		computed: {

		},
		watch: {},
		onLoad(options) {

		},
		onUnload() {

		},
		onReady() {

		},
		onShow() {

		},
		onHide() {

		},
		onResize() {

		},
		onPullDownRefresh() {

		},
		onReachBottom(e) {

		},
		onPageScroll(e) {

		},
		methods: {
			//登录注册-验证码登录
			async getcbc78dca45ebc1Func() {
				if (!validate(this.phone, 'require')) {
					this.$message.info(global.i18n.t('手机号不能为空'));
					return false;
				}
				if (!validate(this.phone, 'phone')) {
					this.$message.info(global.i18n.t('请输入正确的手机号'));
					return false;
				}
				if (!validate(this.verification, 'require')) {
					this.$message.info(global.i18n.t('请输入验证码'));
					return false;
				}
				if (!validate(this.verification, 'captcha')) {
					this.$message.info(global.i18n.t('请输入正确的验证码'));
					return false;
				}
				if (this.di_tk === false) {
					this.$message.info(global.i18n.t('请勾选隐私协议'));
					return false;
				}
				//请求方法
				//数据验证

				let data5f6db4db8abcf = await this.$api.post(global.apiUrls.post5f6db4db8abcf, {
					mobile: this.phone,
					code: this.verification,
					type: '3'
				});

				if (data5f6db4db8abcf.data.code != 1) {
					this.$message.info(data5f6db4db8abcf.data.msg);
					return
				}
				let info5f6db4db8abcf = data5f6db4db8abcf.data;


				//请求方法
				//数据验证

				let datadataList = await this.$api.post(global.apiUrls.post5c78dca45ebc1, {
					mobile: this.phone,
					code: this.verification,
					type: '3'
				});

				if (datadataList.data.code != 1) {
					this.$message.info(datadataList.data.msg);
					return
				}
				let infodataList = datadataList.data;
				this.dataList = infodataList.data

				this.$store.commit('saveToken', this.dataList.userinfo.user_token)
				this.$store.commit('updateUserInfo', this.dataList.userinfo)
				this.$urouter.navigateTo(`/pages/tabBar/index/index`);
			}
		}
	};
</script>
<style lang="scss" scoped>
	.page {
		width: 100vw;
		overflow-x: hidden;
		min-height: calc(100vh - var(--window-bottom));
		background: url(image-path('1571.png')) no-repeat;
		background-size: 100% auto;
	}

	.verificationLogin_flex_0 {
		padding: 0rpx 56rpx 0rpx 56rpx;
	}

	.verificationLogin_fd0_6_c1_c1_c1 {
		color: var(--benbenFontColor4);
		font-size: 28rpx;
		font-weight: 400;
		line-height: 33rpx;
	}

	.verificationLogin_fd0_6_c1_c1_c0 {
		color: var(--benbenFontColor2);
		font-size: 28rpx;
		font-weight: 400;
		line-height: 33rpx;
		margin: 0rpx 0rpx 0rpx 10rpx;
	}

	.verificationLogin_fd0_6_c1_c1 {
		text-align: center;
	}

	.verificationLogin_checkfd0_6_c1_c0_c0_c0 {
		width: 32rpx;
		height: 32rpx;
	}

	.verificationLogin_fd0_6_c1 {
		margin: auto 0rpx 40rpx 0rpx;
	}

	.verificationLogin_fd0_6_c0_c4 {
		width: 64rpx;
		height: 64rpx;
		border-radius: 0rpx 0rpx 0rpx 0rpx;
	}

	.verificationLogin_fd0_6_c0_c0 {
		width: 64rpx;
		height: 64rpx;
		border-radius: 0rpx 0rpx 0rpx 0rpx;
		margin: 0rpx 56rpx 0rpx 0rpx;
	}

	.verificationLogin_fd0_6_c0 {
		margin: 0rpx 0rpx 40rpx 0rpx;
	}

	.verificationLogin_fd0_6 {
		position: fixed;
		bottom: calc(64rpx + var(--window-bottom));
		left: 0rpx;
		width: 750rpx;
		padding: 24rpx 0rpx 0rpx 0rpx;
	}

	.verificationLogin_fd0_5_c0 {
		color: rgba(51, 51, 51, 1);
		font-size: 28rpx;
		font-weight: 400;
		line-height: 40rpx;
	}

	.verificationLogin_fd0_5 {
		margin: 34rpx 0rpx 0rpx 0rpx;
	}

	.verificationLogin_fd0_4 {
		background: #134ddf;
		border-radius: 50rpx 50rpx 50rpx 50rpx;
		font-size: 32rpx;
		color: #fff;
		width: 638rpx;
		height: 88rpx;
		line-height: 88rpx;
		margin: 46rpx 0rpx 0rpx 0rpx;
	}

	.verificationLogin_fd0_3_c0 {
		color: rgba(51, 51, 51, 1);
		font-size: 28rpx;
		font-weight: 400;
		line-height: 40rpx;
		margin: 0rpx 32rpx 0rpx 0rpx;
	}

	.verificationLogin_fd0_3 {
		margin: 32rpx 0rpx 0rpx 0rpx;
	}

	.verificationLogin_fd0_2_c2 {
		background: #134ddf;
		line-height: 64rpx;
		text-align: center;
		font-size: 28rpx;
		color: rgba(255, 255, 255, 1);
		width: 200rpx;
		height: 64rpx;
		border-radius: 32rpx;
		background-size: 100% auto;
	}

	.verificationLogin_fd0_2 {
		background: #E8EEFF;
		border-radius: 44rpx 44rpx 44rpx 44rpx;
		box-shadow: 0rpx 3rpx 6rpx 1rpx #FFF2F4;
		padding: 0rpx 32rpx 0rpx 32rpx;
	}

	.verificationLogin_fd0_1_c1 {
		color: var(--benbenFontColor0);
		font-size: 28rpx;
		font-weight: 400;
		line-height: 40rpx;
		margin: 0rpx 0rpx 0rpx 32rpx;
		height: 88rpx;
	}

	.verificationLogin_fd0_1_c0 {
		width: 34rpx;
		height: 34rpx;
		border-radius: 0rpx 0rpx 0rpx 0rpx;
	}

	.verificationLogin_fd0_1 {
		background: #E8EEFF;
		border-radius: 44rpx 44rpx 44rpx 44rpx;
		box-shadow: 0rpx 3rpx 6rpx 1rpx #FFF2F4;
		padding: 0rpx 32rpx 0rpx 32rpx;
		margin: 84rpx 0rpx 32rpx 0rpx;
	}

	.verificationLogin_fd0_0_c1 {
		color: rgba(57, 65, 98, 1);
		font-size: 32rpx;
		font-weight: 600;
		line-height: 45rpx;
	}

	.verificationLogin_fd0_0_c0 {
		width: 148rpx;
		height: 148rpx;
		border-radius: 40rpx;
	}

	.verificationLogin_fd0_0 {
		margin: 180rpx 0rpx 0rpx 0rpx;
		height: 230rpx;
	}
</style>